﻿@model LoginViewModel

<link href="~/css/login_styles.css" rel="stylesheet" />

<script src="~/js/bootstrap-show-password.js"></script>

<div class="htmleaf-container">
    <div class="wrapper">
        <div class="containerLogin">
            <h1>BlogIdp</h1>


            <partial name="_ValidationSummary" />

            @if (Model.EnableLocalLogin)
            {
                <form asp-route="authorize" class="form login-container">
                    <input type="hidden" asp-for="ReturnUrl" />
                    <input class="login-name" value="" placeholder="Username" asp-for="Username">
                    @*<input class="login-pass" type="password" placeholder="Password" asp-for="Password" autocomplete="off">*@

                    <p class="pass-with-show">
                        <input data-toggle="password"
                               data-placement="after"
                               class="login-pass form-control"
                               type="password"
                               value=""
                               asp-for="Password"
                               placeholder="Password"
                               data-eye-class="material-icons"
                               data-eye-open-class="visibility"
                               data-eye-close-class="visibility_off"
                               data-eye-class-position-inside="true"
                               data-message="点击隐藏或显示密码">
                    </p>


                    @if (Model.AllowRememberLogin)
                    {
                        <div class="form-group login-remember">
                            <label asp-for="RememberLogin">
                                <input asp-for="RememberLogin">
                                <strong>Remember My Login</strong>
                            </label>
                        </div>
                    }

                    <div>
                        <br />
                        <p>   预览效果，请注册，默认角色AdminTest</p>
                    </div>


                    <button type="submit" class="login" name="button" value="login">Login</button>
                    <button name="button" value="cancel">Cancel</button>


                    <p class="to-register"><a href="/account/register" class="register">没有账号? 去注册</a><a href="/account/forgot-password" class="reset">忘记密码？重置</a></p>
                </form>

            }
            @if (Model.VisibleExternalProviders.Any())
            {
                <div class="col-md-6 col-sm-6 external-providers">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">External Login</h3>
                        </div>
                        <div class="panel-body">
                            <ul class="list-inline">
                                @foreach (var provider in Model.VisibleExternalProviders)
                                {
                                    <li>
                                        <a class="btn btn-default"
                                           asp-controller="External"
                                           asp-action="Challenge"
                                           asp-route-provider="@provider.AuthenticationScheme"
                                           asp-route-returnUrl="@Model.ReturnUrl">
                                            @provider.DisplayName
                                        </a>
                                    </li>
                                }
                            </ul>
                        </div>
                    </div>
                </div>
            }
            @if (!Model.EnableLocalLogin && !Model.VisibleExternalProviders.Any())
            {
                <div class="alert alert-warning">
                    <strong>Invalid login request</strong>
                    There are no login schemes configured for this client.
                </div>
            }

        </div>

        <ul class="bg-bubbles">
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </div>
</div>


